<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
{insert name="module_cssjs" css="core.css" js="jquery.min.js"}
</head>
{literal}
<script type="text/javascript">
$(document).ready(function() {
$('[name="del"]').click(function() {
	var $this = this;
	var uid = $(this).parents('tr').attr('uid');
	if(!uid) {
		alert('缺少参数');return ;
	}
	if(!confirm('您确定删除此用户吗？'))return ;
	
	var params = {'uid': uid};
	$.post('/rbac/user/del.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			$($this).parents('tr').remove();
		}
	}, 'json');
});
})
</script>
{/literal}
<body>
<h3 class="label">
	<strong class="on"><span>所有用户</span></strong>
	<strong><span><a href="/rbac/user/add">添加用户</a></span></strong>
	<span class="refresh"><a href="">刷新</a></span>
</h3>
<div class="table">
	<table class="TB-list">
		<tr class="TB-header">
			<td width="50">用户UID</td>
			<td>登录名</td>
			<td>真实姓名</td>
			<td width="200">操作</td>
		</tr>
		{foreach item=item key=key from=$users.data name=list}
		<tr {if $smarty.foreach.list.index%2 == 0}class="even"{else}class="odd"{/if} uid="{$item.uid}">
			<td>{$item.uid}</td>
			<td>{$item.username}</td>
			<td>{$item.realname}</td>
			<td>[<a href="/rbac/user/edit?uid={$item.uid}">编辑</a>] [<a href="javascript:void(0);" name="del">删除</a>]</td>
		</tr>
		{/foreach}
	</table>
	<div>{insert name="module_page" query=$query size=$users.size num=$users.num page=$users.page}</div>
</div>

</body>
</html>